package com.example.alipush

import android.app.Application
import android.content.Context
import com.alibaba.sdk.android.push.CommonCallback
import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory

class AliPushApplication: Application() {

    override fun onCreate() {
        super.onCreate()
        initCloudChannel(this)
    }

    private fun initCloudChannel(applicationContext: Context) {
        PushServiceFactory.init(applicationContext)
        val pushService = PushServiceFactory.getCloudPushService()
        pushService.register(applicationContext, object: CommonCallback{
            override fun onSuccess(response: String?) {

            }

            override fun onFailed(errorCode: String?, errorMessage: String?) {

            }
        })
    }
}